package com.kstudio.videocapture.util;

import android.util.Log;

public final class KLog {

    private boolean LOG;
    private String TAG;

    private static final boolean KVideoCapture  = true;

    private static final boolean KFileList  = true;

    private static final boolean KImageList = true;

    private static final boolean KVideoEdit = true;
    private static final boolean KImageEdit = true;

    private static final boolean KVideoCaptureAsync = false;
    private static final boolean KLoadBitmapAsync = true;
    private static final boolean KAsyncLoadBitmap = true;
    private static final boolean KAnimation         = false;

    private static final boolean KSeekView                  = false;
    private static final boolean KImageListViewAlbumIcon    = false;
    private static final boolean OpenGL                     = false;

    public KLog(String tag) {
        TAG = tag;

        if(tag.equals("KVideoCapture")) {
            LOG = KVideoCapture;
        } else if(tag.equals("KFileList")) {
            LOG = KFileList;
        } else if(tag.equals("KImageList")) {
            LOG = KImageList;
        } else if(tag.equals("KVideoEdit")) {
            LOG = KVideoEdit;
        } else if(tag.equals("KImageEdit")) {
            LOG = KImageEdit;
        } else if(tag.equals("KVideoCaptureAsync")) {
            LOG = KVideoCaptureAsync;
        } else if(tag.equals("KLoadBitmapAsync")) {
            LOG = KLoadBitmapAsync;
        } else if(tag.equals("KAsyncLoadBitmap")) {
            LOG = KAsyncLoadBitmap;
        } else if(tag.equals("KAnimation")) {
            LOG = KAnimation;
        } else if(tag.equals("KSeekView")) {
            LOG = KSeekView;
        } else if(tag.equals("KImageListViewAlbumIcon")) {
            LOG = KImageListViewAlbumIcon;
        } else if(tag.equals("OpenGL")) {
            LOG = OpenGL;
        } else {
            LOG = false;
            e("%s tag is not define",TAG);
        }
    }

    public void v(String format, Object... args) {
        if(LOG) Log.v(TAG, String.format(format, args));
    }

    public void d(String format, Object... args) {
        if(LOG) Log.d(TAG, String.format(format, args));
    }

    public void i(String format, Object... args) {
        if(LOG) Log.i(TAG, String.format(format, args));
    }

    public void w(String format, Object... args) {
        if(LOG) Log.v(TAG, String.format(format, args));
    }

    public void e(String format, Object... args) {
        Log.e(TAG, String.format(format, args));
    }
}